package zsm;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Iterator;
import javax.faces.model.SelectItem;

class class_base {
	
	  int id;
	  protected int counter=0;
	  protected Iterator it;

	int getId() {
		return id;
	}
	  void setId(int id) {
		this.id = id;
	}
	  protected boolean sprawdz1(String ... wartosci){
		  for (int i = 0; i < wartosci.length; i++) {
			  System.out.println("wartosc="+wartosci[i]);
			  if (wartosci[i]=="")
				  return false;
		  }
		  return true;
	  }
	protected boolean sprawdz(String nazwKlasy){
		try {
            Class cls = Class.forName(nazwKlasy);
            Field fieldlist[] = cls.getDeclaredFields();
            for (int i = 0; i < fieldlist.length; i++) {
               Field fld = fieldlist[i];
               //tylko pola do ktorych wprowadzane sa dane z formularza
               //Ogloszenie ff=this;//new Ogloszenie();
               Field dd=Ogloszenie.class.getDeclaredField(fieldlist[i].getName());
               dd.setAccessible(true);
               String bb=(String) dd.get(this);
               System.out.println("wartosc bb"+bb);
               //MyObject objectInstance = new MyObject();
               
               
        	   //System.out.println(">>"+fld.se.set(String.class,"warto"));
               //if (fld.getName().substring(0,9)=="formularz")
               //{
            	   //Object value = fld.get(fld.getName());
            	   //cls.
            	   //System.out.println("walue"+value);
                   //field.set(objetInstance, value);
            	   
            	   if (fld.getName()=="")
            		   return false;
               //}
               /*System.out.println(fld.getName().substring(0,9)+"<name"+ fld.getName());
               System.out.println("decl class = " + fld.getDeclaringClass());
               System.out.println("type = " + fld.getType());
               int mod = fld.getModifiers();
               System.out.println("modifiers = " +  Modifier.toString(mod));
               System.out.println("-----");
               if (fld.getName().equals(""))
            	   return false;*/
            }
            return true;
          }
          catch (Throwable e) {
             System.err.println(e);
             return false;
          }
	}
	
}
